import { useAxios } from '@/hooks/web/useAxios'
import type { FolderVO } from './types'

const request = useAxios()

// 查询文件夹（精简)列表
export const listSimpleFolderApi = () => {
  return request.get({ url: '/xiaoBizHandler/xTbFolder/list-all-simple' })
}

// 查询文件夹列表
export const getFolderPageApi = (params) => {
  return request.get({ url: '/xiaoBizHandler/xTbFolder/list', params })
}

// 查询文件夹详情
export const getFolderApi = (id: number) => {
  return request.get({ url: '/xiaoBizHandler/xTbFolder/get?id=' + id })
}

// 新增文件夹
export const createFolderApi = (data: FolderVO) => {
  return request.post({ url: '/xiaoBizHandler/xTbFolder/create', data: data })
}

// 修改文件夹
export const updateFolderApi = (params: FolderVO) => {
  return request.put({ url: '/xiaoBizHandler/xTbFolder/update', data: params })
}

// 删除文件夹
export const deleteFolderApi = (id: number) => {
  return request.delete({ url: '/xiaoBizHandler/xTbFolder/delete?id=' + id })
}
